﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartSpace.Cwt
{
    public class InstallService : IInstallService
    {
        private ICwtFactory _factory;

        public InstallService(ICwtFactory factory)
        {
            _factory = factory;
        }

        public void Install()
        {
            using (CwtContext context = _factory.Get())
            {
                if (context.Database.Exists())
                {
                    context.Database.Delete();
                }
                context.Database.Create();
            }
        }
    }
}
